package elearning.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "TOEIC_CATEGORY")
public class ToeicCategory implements Serializable, Cloneable {

	static final long serialVersionUID = 1L;
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	Integer id;

	@Column(name = "NAME", length = 500)
	String name;

	@Column(name = "DESCRIPTION", length = 2000)
	String description;

	@Column(name = "NUM_EXERCISE")
	Integer numExercise;

	@Column(name = "TOTAL_TIME")
	Integer totalTime;

	@Column(name = "SCORE")
	Integer score;

	@Column(name = "ADMIN_URL")
	String adminUrl;

	@Column(name = "STATUS")
	@Enumerated(EnumType.ORDINAL)
	ToeicCategoryStatus status;

	@Basic
	@Column(name = "CREATED_TIME",columnDefinition="TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP")
	@Temporal(TemporalType.DATE)
	Date createdTime;

	

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getNumExercise() {
		return numExercise;
	}

	public void setNumExercise(Integer numExercise) {
		this.numExercise = numExercise;
	}

	public Integer getTotalTime() {
		return totalTime;
	}

	public void setTotalTime(Integer totalTime) {
		this.totalTime = totalTime;
	}

	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	public String getAdminUrl() {
		return adminUrl;
	}

	public void setAdminUrl(String adminUrl) {
		this.adminUrl = adminUrl;
	}

	public ToeicCategoryStatus getStatus() {
		return status;
	}

	public void setStatus(ToeicCategoryStatus status) {
		this.status = status;
	}

	public Date getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}

	public ToeicCategory() {
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof ToeicCategory)) {
            return false;
        }
        ToeicCategory other = (ToeicCategory) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "elearning.model.ToeicCategory[ id=" + id + " ]";
    }
}
